/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */
package com.wisnu.tutorial.main;

import com.wisnu.tutorial.controller.MainController;
import com.wisnu.tutorial.sql.Connection;
import javax.swing.JOptionPane;

/**
 *
 * @author Wisnu Wardoyo
 */
public class Main {

    Connection connection = new Connection();

    public Main() {
        if (connection.check()) {
            MainController controller = new MainController(connection);
        } else {
            JOptionPane.showConfirmDialog(null, "Connection not Found", "Warning", JOptionPane.CLOSED_OPTION, JOptionPane.PLAIN_MESSAGE);
        }
    }

    public static void main(String[] args) {
        java.awt.EventQueue.invokeLater(new Runnable() {
            @Override
            public void run() {
                Main main = new Main();
            }
        });
    }

}
